package command;

import model.IncrementalCostCalculator;
import model.IncrementalValidator;

public class MoveFactory {
	
	private static IncrementalMoveProcessToMachineCommand[] cache;
	static int i=0;
	static int LENGTH = 1000;
	
	public static void init(IncrementalValidator iv, IncrementalCostCalculator icc) {
		cache = new IncrementalMoveProcessToMachineCommand[LENGTH];
		for(int i=0;i<cache.length;i++)
			cache[i] = new IncrementalMoveProcessToMachineCommand(iv, icc);
	}
	
	public static IncrementalMoveProcessToMachineCommand getMove(){
		return cache[i++%LENGTH];
	}

}
